<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    function Area(height, width) {

        return height * width;
        return (Math.PI * height * width).toFixed(2); // 保留两位小数


        
    }

    let res = Area(10, 20);

    console.log(res);

    // 传入一个数字n,计算1-n的数字和

    function sum(n) {

        let sum = 0;

        for (let i = 1; i <= n; i++) {

            sum += i;

        }

        return sum;

    }

    function sum2(n) {
        return n * (n + 1) / 2;
    }

</script>
</html>